module.exports = (app) => {
  const { STRING, INTEGER, DATE, NOW } = app.Sequelize

  const Dict = app.model.define(
    'sys_dict',
    {
      id: {
        type: INTEGER,
        primaryKey: true,
        autoIncrement: true,
        comment: '字典ID'
      },
      dict_name: {
        type: STRING,
        comment: '字典名称'
      },
      dict_code: {
        type: STRING,
        comment: '字典代码'
      },
      created_at: {
        type: DATE,
        allowNull: false,
        defaultValue: NOW,
        comment: '创建时间'
      },
      updated_at: {
        type: DATE,
        allowNull: false,
        defaultValue: NOW,
        comment: '更新时间'
      }
    },
    {
      freezeTableName: true, // Model 对应的表名将与model名相同
      timestamps: false
    }
  )
  return Dict
}
